
# A2_create_plots
#==============================================================================

# Description: This file plots the cost estimates, used in Figure 2

rm(list = ls())

library("data.table")  
library("ggplot2")  
library("ggrepel")  
library("stargazer")  

output <- fread('output_files/m1_partner_EU.csv')

plot_m1 <- ggplot(output, aes(x=gdp_log, y=m1)) +
                geom_text_repel(label=output$iso3, size = 5) +
                theme(text = element_text(size=17)) +
                geom_smooth(method=lm) +
                labs(x = "GDP per capita (in logs)", y = "Estimate m1") 
                
ggsave("plot_m1_gdp.png", plot = plot_m1)



output <- fread('output_files/m1_q_partner_EU.csv')

plot_m1_q <- ggplot(output, aes(x=q, y=m1)) +
  geom_text_repel(label=output$iso3, size = 5) +
  theme(text = element_text(size=17)) +
  geom_smooth(method=lm) +
  labs(x = "Quality", y = "Estimate m1") 

ggsave("plot_m1_q.png", plot = plot_m1_q)




